package com.codeforces.contest.c298;
import java.util.Arrays;
import java.util.Scanner;


public class _298D {

	static Scanner scanner = new Scanner(System.in);
	static int n, m, k;
	static int[] a, b;

	public static void main(String[] args) {
		n = scanner.nextInt();
		m = scanner.nextInt();
		k = scanner.nextInt();
		if (n > m) {
			System.out.println("YES");
			return;
		}
		a = new int[n];
		b = new int[m];
		for (int i=0;i<n;++i) {
			a[i] = scanner.nextInt();
		}
		for (int i=0;i<m;++i) {
			b[i] = scanner.nextInt();
		}
		Arrays.sort(a);
		Arrays.sort(b);
		int i = n-1;
		int j = m-1;
		while (i >= 0 && j >= 0) {
			if (a[i] > b[j]) {
				System.out.println("YES");
				return;
			}
			--i;
			--j;
		}
		System.out.println("NO");
	}

}
